package org.openmore.consumer.service.feignImpl;

import feign.hystrix.FallbackFactory;
import org.openmore.consumer.dto.api.PlatformConfigDto;
import org.openmore.consumer.dto.common.BaseResponse;
import org.openmore.consumer.dto.common.PlatformConfig;
import org.openmore.consumer.entity.enums.PlatformType;
import org.openmore.consumer.service.feign.PlatformConfigService;
import org.springframework.stereotype.Component;

@Component
public class PlatformConfigServiceImpl extends BaseFeignFallback implements FallbackFactory<PlatformConfigService> {
    @Override
    public PlatformConfigService create(Throwable cause) {
        return new PlatformConfigService() {
            @Override
            public BaseResponse selectAll(String tenantId, PlatformType platformType, String appid, String mchKey, Integer pageNum, Integer pageSize) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse selectCount(String tenantId, PlatformType platformType, String appid, String mchKey) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse insert(PlatformConfigDto platformConfig) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse update(PlatformConfigDto platformConfig) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse deleteById(String id) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse queryById(String id) {
                return getFallBackResponse();
            }
        };
    }
}
